#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;




int mainx()
{

	vector<vector<size_t>> v;
	size_t n;
	cin >> n;
	v.resize(n);
	
	for (size_t i = 0; i < n; ++i)
	{
		v[i].resize(4);
		for (size_t j = 0; j < 4; ++j)
		{
			cin >> v[i][j];
		}
	}


	for (size_t i = 0; i < n; ++i)
	{
		for (size_t j = 0; j < v[i][3]; ++j)
		{
			size_t t1 = (size_t)((v[i][1] + v[i][2]) / 2);
			size_t t2 = (size_t)((v[i][0] + v[i][2]) / 2);
			size_t t3 = (size_t)((v[i][1] + v[i][0]) / 2);

			v[i][0] = t1;
			v[i][1] = t2;
			v[i][2] = t3;
		}
	}
	

	for (size_t i = 0; i < n; ++i)
	{
		for (size_t j = 0; j < 3; ++j)
		{

			cout << v[i][j] << " ";
		}
		cout << endl;
	}
		

	return 0;
}